package controllers

import (
	"fmt"
	"github.com/astaxie/beego"
	"github.com/astaxie/beego/orm"
	"gowe/dbs"
	"gowe/models"
)

type WexinController struct {
	beego.Controller
}

func (this *WexinController) Get() {
	url := beego.AppConfig.String("url")
	this.Data["AppId"] = beego.AppConfig.String("AppId")
	this.Data["url"] = url

	o := orm.NewOrm()
	var user models.User
	id, err := o.Insert(&user)

	if err == nil {
		fmt.Println(id)
	}

	result := dbs.Get("heshuai")
	fmt.Println(result)
	this.TplName = "index.tpl"
}
